//TIP 要<b>运行</b>代码，请按 <shortcut actionId="Run"/> 或
// 点击装订区域中的 <icon src="AllIcons.Actions.Execute"/> 图标。
public class Main {
    public static void main(String[] args) {
        //TIP 当文本光标位于高亮显示的文本处时按 <shortcut actionId="ShowIntentionActions"/>
        // 查看 IntelliJ IDEA 建议如何修正。
        LoanCalculator loanCalculator = new LoanCalculator(100,360,0.049);
        loanCalculator.calculateAvgInterest();
        loanCalculator.calculateAvgCap();
      JFrame frame = new JFrame("贷款计算器");
      frame.setLayout(new FlowLayout());
      JLabel labelAmount = new JLabel("贷款本金");
      JLabel labelaPeriod = new JLabel("贷款期数");
      JLabel labelInterest = new JLabel("贷款年利率");
      frame.add(labelAmount);
      frame.add(labelaPeriod);
      frame.add(labelInterest);
      frame.setVisible(true)
    }
}